Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps engines #1

Merged
merged 3 commits into from
May 10, 2015
Merged

Maps engines #1

merged 3 commits into from
May 10, 2015

Conversation

timo-42
Copy link

@timo-42 timo-42 commented May 7, 2015

created virtual class for map engines

engines:

  • static: simple creates map with dirt
  • detrumi: engine from detrumi
  • mandelbrot: create map with an island as mandelbrot set shape

@detrumi
Copy link
Owner

detrumi commented May 7, 2015

Creating support for multiple map engines is a good idea. I'll go through the code later, but I've already got some comments:

  • Engine is kind of a bad name, because we already got a game engine. Maybe just MapGen or something like that?
  • Isn't the directory structure too deep? Wouldn't cpp/mapgen/Mapgen.cpp and cpp/mapgen/static/static.cpp be good enough for now?
  • Using usernames as filenames is a bad idea. Rename detrumi to heightmap.
  • We shouldn't put too much work in the Terrain enum. There's ongoing work on the nyan specification, which will introduce nice data types for terrain and unit types.

Also note that my heightmap idea (based on the diamond-square algorithm) isn't working correctly yet, and may only work for the height generation step, and not the land generation (if we're following the same structure as the random map scripts in AoC, which we haven't decided yet).

@detrumi
Copy link
Owner

detrumi commented May 9, 2015

Your code looks fine, just a few last things:

  • mapgen.cpp and diamondsquare.cpp do the same thing (same with the header files). Did you intend to move it but left the old one there?
  • There are some empty lines with just tabs in it, and some files don't have a newline at end of file. Look for some editor options to fix this sort of thing automatically (i.e. sublime text has ensure_newline_at_eof_on_save and trim_trailing_white_space_on_save)
  • You have some very small fix commits, it would be nice if you did a rebase for those. Check out contributing.md for instructions on how to do a rebase. Marking the very small commits as fixup is good enough.

detrumi and others added 3 commits May 10, 2015 13:31
engines:
 static:        simple creates map with dirt
 diamondsquare: engine from detrumi
 mandelbrot:    create map with mandelbrot set
detrumi added a commit that referenced this pull request May 10, 2015
@detrumi detrumi merged commit 4a75654 into detrumi:master May 10, 2015
@detrumi
Copy link
Owner

detrumi commented May 10, 2015

It looks good now, so I merged it.

(I accidentally merged it into detrumi:master instead of detrumi:random-maps, but I've fixed that afterwards)

@TheJJ
Copy link

TheJJ commented May 10, 2015

@timohaas depends on your intentions, but your pull requests will be visible to a much broader audience if you submit them to the root project directly.

Of course i hope that detrumi will bring them upstream anyhow, but subforks are probably not that good, you'll also miss the CI builds then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants